import React from 'react';
import dynamic from 'dva/dynamic';
import { Route } from 'dva/router';


export default function recommendAndRankRoute(app) {

    const Recommends = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "recommendModel" */'../models/recommendAndRank/recommendModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "recommends" */'../routes/recommendAndRank/recommend'),
    });

    const Rank = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "rankModel" */'../models/recommendAndRank/rankModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "ranks" */'../routes/recommendAndRank/Rank'),
    });


    return (
        [
            <Route key="/recommends" exact path="/recommends" component={Recommends}/>,
            <Route key="/rank" exact path="/rank/:storeId" component={Rank}/>
        ]
    );
}
